#include "printTest.h"

void PrintTest::run(void *parameter)
{
    int num = 0;
    std::string str = "Hello World ";
    std::string *p = &str;

    while (1)
    {
        if (this->buttonSem->wait(0))
        {
            num++;
            rt_kprintf("PrintTest: Semaphore taked.\r\n");

            if (this->buttonMail->put(p, 0))
            {
                rt_kprintf("PrintTest: MailBox sent %s.\r\n", p->c_str());
            }
        }
        if (this->buttonQueue->get(num, 0))
        {
            rt_kprintf("PrintTest: Queue get %d.\r\n", num);
        }

        rt_thread_mdelay(100);
    }
}
